package interfaces

// ItfOptimisticLock 乐观锁实现
type ItfOptimisticLock interface {
	Lock(name string) bool
	UnLock(name string) bool
}

// ItfDistributeLocker 分布式锁接口
type ItfDistributeLocker interface {
	Lock(key string, ttl int64) (bool, error) //加锁
	Release(key string) error                 //释放锁

	Delay(key string, ttl int64) error //延迟锁，对锁进行续期延长
	TTL(key string) (int64, error)     //锁剩余时间
}
